#pragma once

#include "dbcDefine.h"
#include "dictionary.h"
#include "IDatabaseConnManage.h"

#include <string>
using std::string;

LIBDBC_BEGIN_NAMESPACE

class DatabaseConn;


class DatabaseConnManage : public IDatabaseConnManage
{
protected:
  dictionary<std::string, DatabaseConn*> _connections;

public:
  DatabaseConnManage(void);
  virtual ~DatabaseConnManage(void);


  virtual bool setConnection( string key, string dbms, string host, string database, string user, string pwd);
  virtual IDatabase* getOpenConnectionHandle( string key );
  virtual void markConnectionHandleUnused(string key);
  virtual bool hasConnection(string key);
  virtual bool removeConnection(string key);


};


LIBDBC_END_NAMESPACE
